package com.kgc.crowd.distributioncrowdwebui.controller;

import com.kgc.crowd.distributioncrowdcommon.api.ProjectMangerRemoteService;
import com.kgc.crowd.distributioncrowdcommon.pojo.ProjectPO;
import com.kgc.crowd.distributioncrowdcommon.pojo.ResultEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class IndexController {
    @Resource
    ProjectMangerRemoteService projectMangerRemoteService;
    @RequestMapping({"/index","/"})
    public String index(Model model){
        ResultEntity<List<ProjectPO>> listResultEntity = projectMangerRemoteService.selectProject();
        model.addAttribute("projectList",listResultEntity.getData());
        return "index";
    }
}
